<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group district">
        <label for="c-district" class="control-label col-xs-12 col-sm-2">请选择地址:</label>
        <div class="col-xs-12 col-xs-2 hide">
            <select name="row[province_id]" data-rule="required" data-id="{$row.province_id}" class="form-control province">
                <option value="0" selected="selected">请选择省</option>
            </select>
        </div>
        <div class="col-xs-12 col-xs-2 hide">
            <select name="row[city_id]" data-rule="required" data-id="{$row.city_id}" class="form-control city">
                <option value="0">请选择市</option>
            </select>
        </div>
        <span style="line-height: 31px;float: left;margin-left: 15px;">广东省深圳市</span>
        <div class="col-xs-12 col-xs-2">
            <select name="row[area_id]" data-rule="required" data-id="{$row.area_id}" class="form-control district">
                <option value="0">请选择区</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="c-area_id" class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="button" id="iframes" class="btn btn-info">点击获取定位地址</button>
        </div>
    </div>
    <div class="form-group hide">
        <label for="c-area_id" class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-address" data-rule="required" class="form-control address" name="row[address]" type="text" v-model="keyword" data-value="" ref="keyword" value="{$row.address}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-lat" class="control-label col-xs-12 col-sm-2">{:__('Lat')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-lat" data-rule="required" class="form-control lat" name="row[lat]" type="text" v-model="lat" data-value="" ref="lat" value="{$row.lat}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-lng" class="control-label col-xs-12 col-sm-2">{:__('Lng')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-lng" data-rule="required" class="form-control lng" name="row[lng]" type="text" v-model="lng" data-value="" ref="lng" value="{$row.lng}">
        </div>
    </div>
    <script>
        window.onload = function () {
            require.config({
                paths: {
                    'jquery': '../libs/jquery/dist/jquery.min',
                    'layer': '../libs/fastadmin-layer/dist/layer'
                }
            });
            require(['jquery', 'layer'],function($, layer){
                $('#iframes').on('click', function(){
                    // 禁用按钮防止重复提交
                    $("#job_address").attr({ disabled: "disabled" });//不加的话容易滑屏...
                    layer.open({
                        type: 2,
                        title: '腾讯地图定位',
                        maxmin: false,
                        shadeClose: true, //点击遮罩关闭层
                        area: ['550px', '105%'],
                        content: ["/map/map.html",'no']
                    });
                });
            });
        }
    </script>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
